﻿using Xunit;
using YAPL.Language.Ast;

namespace YAPL.Test.YAPL.Language.Ast {

	public class UnaryExpressionTest {
		[Fact]
		public void NodeEqualsShouldWorkCorrectly() {
			var un1 = Expressions.Unary(Expressions.Variable("a"), UnaryOperator.Plus);
			var un2 = Expressions.Unary(Expressions.Variable("b"), UnaryOperator.Minus);
			var un3 = Expressions.Unary(Expressions.Variable("c"), UnaryOperator.Plus);

			Assert.False(un1.NodeEquals(null));
			Assert.False(un1.NodeEquals(un2));
			Assert.False(un1.NodeEquals(Expressions.StringLiteral("literal")));
			Assert.True(un1.NodeEquals(un3));
		}
	}
}
